import market from '../api/market';

import * as actionTypes from '../constants/market';

const allTicker = (data) => ({
  type: actionTypes.GET_ALL_TICKER,
  data: data
});

export const getAllTicker = () => {
  return (dispatch) => {
    market.allTicker().then(res => {
      let data = res.data;
      if(data.state == 1){
        dispatch(allTicker(data.data))
      }
    });
  }
};